import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    title: 'Image Demo',
    home: ImageDemo(),
  ));
}

class ImageDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(
      // 添加网络图片
      child: Image.network(
        // 图片URL
        'https://cdn.jsdelivr.net/gh/flutterchina/website@1.0/images/homepage/header-illustration.png',
        // 填充模式
        fit: BoxFit.fitWidth,
      ),
    );
  }
}
